﻿package{
	import wck.World;
	import Box2DAS.Common.V2;
	import Box2DAS.Dynamics.b2Body
	import wck.BodyShape
	import gravity.Gravity;
	
	import flame;
	
	public class gravityModWorld extends World{
		
		//overridden for custom gravity effect on flame
		
		private var normalGravityY:int;
		public function gravityModWorld(){
			
		}
		public override function create():void {
			super.create();
			normalGravityY = baseGravity.y;
		}
		public override function getGravityFor(p:V2, b:b2Body = null, b2:BodyShape = null):V2 {
			baseGravity.y=normalGravityY;
			//if(b.GetUserData() == "[object flame]"){
			if(b.GetUserData() is flame){
				p.y = -2
				baseGravity.y=-2;
			}
			
			return super.getGravityFor(p,b,b2);
		}
	}
}